<?php
#测试套餐移除
ini_set('display_errors', 1);
error_reporting(-1);
require_once '/data/wwwroot/g_vendor/autoload.php';
ini_set('memory_limit', '512M');

/**
 * 获取全部gray测试套餐
 * @return array|bool
 */
function getAllTestPackages()
{
    $packages = [];
    $pack_where['pack_type[>=]'] = 10000;
    $mResult = \Biz\model\brand\BrandPackage::select('*', $pack_where);
    if ($mResult && is_array($mResult)) {
        $packages = $mResult;
    }
    return $packages;
}


$testPackage = getAllTestPackages();

$packageIds = array_column($testPackage, 'id');

var_dump($packageIds);

if(empty($packageIds)){
    echo "no test packages".PHP_EOL;
    exit;
}


$where['id'] = $packageIds;

$ret = \Biz\model\brand\BrandPackage::delete($where);

var_dump($ret);

var_dump(\Biz\model\brand\BrandPackage::sqlLogs());

exit;